from selenium import webdriver
from scrapy.selector import Selector


#知乎的模拟登录
browser = webdriver.Chrome(executable_path="d:/chromedriver.exe")  #路径是chromedriver.exe的存放的位置
browser.get("https://www.zhihu.com/#signin")
browser.find_element_by_css_selector(".view-signin input[name='account']").send_keys("18603029865") #帐号
browser.find_element_by_css_selector(".view-signin input[name='password']").send_keys("my19921212") #密码
browser.find_element_by_id("captcha").send_keys(input('请输入验证码：'))
browser.find_element_by_css_selector(".view-signin button.sign-button").click() #登录
browser.quit()